package com.taoding.hfhclient.netty_client;

/**
 * @author liuxinghong
 * @Description:
 * @date 2019/9/5 000516:13
 */
public class NettyConfig {

    /**
     * netty消息类型  1 通知消息 2 对话消息 3 执行指令消息 0 普通消息  -1 首次连接建立客户端和服务器端识别 -2 心跳消息
     */
    public static final Integer NETTY_FIRST_CONNECT_TYPE =-1;
    public static final Integer NETTY_HEARTBEAT_TYPE =-2;
    public static final Integer NETTY_COMMON_TYPE =0;
    public static final Integer NETTY_NOTICE_TYPE =1;
    public static final Integer NETTY_DIALOGUE_TYPE =2;
    public static final Integer NETTY_INSTRUCT_TYPE =3;
    public static final Integer NETTY_MESSAGE_REPLY_TYPE =4;

    /**
     * netty服务端识别id
     */
    public static  final  String NETTY_SERVER_ID= "0000000000";
    /**
     * netty心跳相关配置
     */
    public static final String  NETTY_SERVER_IP = "192.169.0.96";
    public static final Integer  NETTY_SERVER_PORT = 9999;
    public static final Integer  NETTY_SERVER_FCOUNT_TIMES = 1; //服务端未接收到心跳的循环次数  超过次次数将关闭该通道
    public static final Integer  NETTY_CLIENT_FCOUNT_TIMES = 2; //客户端心跳发送循环次数 触发后连续发送的ci数
    public static final Integer  NETTY_CLIENT_WRITER_IDLE_TME_TIMES= 0; //writerIdleTme: 0  #（秒）如果 秒内write()方法未被调用则触发一次userEventTrigger()方法，实现客户端每 秒向服务端发送一次消息
    public static final Integer  NETTY_CLIENT_ALL_IDLE_TME_TIMES= 30;//allIdleTme: 60     # 秒检测一次客户端发来的心跳请求  如果 秒内ChannelRead()方法和write()方法未被调用则触发一次userEventTrigger()方法

    /**
     * netty断线重连次数
     */
    public static final Integer NETTY_RECONNECT_COUNT= 5; //客户端断线重新连接次数
    public static final Integer NETTY_RECONNECT_TIME= 60; //客户端断线重新连接间隔时间 （秒）
}
